﻿package lobby
{
	import flash.events.Event;
	import lobby.events.LobbyEvent;
	import flash.external.ExternalInterface;
	
	/**
	 * ...
	 * @author Doan Nguyen Thuy Nha Truc (Bamboo)
	 */
	public class GameLocalConnection extends BaseLocalConnection
	{
		
		public function GameLocalConnection()
		{
			super();
		}
		
		
		public function recieveGameDetailText(date:String):void
		{
			var text:String = super.connectionNameSend + " : " + GlobalVariables.lang + " : " + 
			GlobalVariables.userName + " : " + GlobalVariables.pass + " : " + GlobalVariables.roomId + " : " + 
			GlobalVariables.IsMemberSpecial + " : " + GlobalVariables.siteName + "@" + GlobalVariables.subDomain + 
			" casinoId: " + GlobalVariables.casinoId + " fmsVideo: " + GlobalVariables.fmsVideo + " fmsMonitor: " + 
			GlobalVariables.fmsMonitor + " limelight: " + GlobalVariables.limelight + " preUserId: " + GlobalVariables.preUserId + 
			" demo: " + GlobalVariables.demo + " hidePassword: " + GlobalVariables.hidePassword + " parentSID: " + GlobalVariables.parentSID;
			
			ExternalInterface.call("alertScript", "recieveGameDetailText \\ " + text);
			trace("text : " + text);
			super.localConnection.send(super.connectionNameSend, "recieveMainText", GlobalVariables.lang, GlobalVariables.userName, 
			GlobalVariables.pass, GlobalVariables.roomId, GlobalVariables.IsMemberSpecial, GlobalVariables.langInfo.arrayLang, 
			GlobalVariables.langInfo.arrID, GlobalVariables.siteName + "@" + GlobalVariables.subDomain, GlobalVariables.casinoId, 
			GlobalVariables.fmsVideo, GlobalVariables.fmsMonitor, GlobalVariables.limelight, GlobalVariables.preUserId, 
			GlobalVariables.demo, GlobalVariables.hidePassword, GlobalVariables.parentSID, GlobalVariables.dynamicLobby, GlobalVariables.showTransfer);
		}
		
		public function sendLogOutMain(date:String, info:String):void
		{
			var LogMeOut:String = "";
			if (GlobalVariables.casinoId == "12" || GlobalVariables.roomId == "3bac" || GlobalVariables.roomId == "20" || 
				GlobalVariables.roomId == "21" || GlobalVariables.roomId == "22" || GlobalVariables.roomId == "23" || 
				GlobalVariables.roomId == "24") {
				LogMeOut = super.connectionNameSend;				
			}else {
				LogMeOut = "LogMeOutMeg"+date;
			}
			super.localConnection.send(LogMeOut, "receiveLogoutmain", info);			
		}
		

		public function TokenText(info:String):void
		{			
			//super.localConnection.send("TokenFail" + GlobalVariables.getDate, "TokenText", "info");
		}
		
		public function receiveLogoutmain(str:String):void
		{
			//dispatchEvent(new LobbyEvent(LobbyEvent.CLOSE_GAME));
		}
	}

}